/*
 * @Author: szx
 * @Date: 2022-03-31 12:56:28
 * @LastEditTime: 2022-03-31 12:58:40
 * @Description:
 * @FilePath: \leetcode\剑指offerII\006\006.js
 */
/**
 * @param {number[]} numbers
 * @param {number} target
 * @return {number[]}
 */
var twoSum = function (numbers, target) {
    let i = 0,
        j = numbers.length - 1;
    while (i < j) {
        if (numbers[i] + numbers[j] == target) return [i, j];
        else if (numbers[i] + numbers[j] < target) i++;
        else j--;
    }
    return [];
};
